/*
 *Copyright © 2015 zhaorongbao
 *招融宝
 *http://zhaorongbao.com
 *All rights reserved.
 */
package com.hanhai.zrb.api.biz.dao.mybatis;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.hanhai.zrb.api.biz.dao.mybatis.base.BaseMapper;

public interface SequenceDao extends BaseMapper {

	@Select("select current_value from sequence where name = #{name} for update")
	public Long getCurrentValue(String name);

	@Update("update sequence set current_value = current_value + 1 where name = #{name} ")
	public Long update(String name);

	@Update("update sequence set current_value =  1 where name = #{name} ")
	public void reset(String name);
}
